<!DOCTYPE html>
<html class="no-js">
<head>
<meta name="Keywords" content="<{:C('site_keyword')}>">
<meta name="Description" content="<{:C('site_content')}>">
<title><{:C('site_title')}></title>
<!-- 移动设备支持 -->
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" href="<{:STATICS}>/amaze/css/amazeui.min.css">
<link rel="stylesheet" href="<{:RES}>/css/app.css?v=1.06">
<script src="<{:STATICS}>/amaze/js/jquery.min.js"></script>
<script src="<{:STATICS}>/amaze/js/amazeui.min.js"></script>
<script src="<{:STATICS}>/js/jquery.form.min.js"></script>
<script src="<{:RES}>/js/common.js"></script>
</head>
<style>
.deploy_ctype_tip{z-index:1001;width:100%;text-align:center;position:fixed;top:50%;margin-top:-23px;left:0;}
.deploy_ctype_tip p{display:inline-block;padding:13px 24px;border:solid #d6d482 1px;background:#f5f4c5;font-size:16px;color:#8f772f;line-height:18px;border-radius:3px;}
.payInfo{text-align: center; font-size: 2rem; padding: 20px 0}
.payInfo span{ color: #f00; display: block;}
</style>
<body>
<div id="loading" class="loading"></div>

<div class="page">	

	<header class="am-header am-header-default">
    	<h1 class="am-header-title">微信支付</h1>
  	</header>

  	<script language="javascript">
	function callpay() {
		WeixinJSBridge.invoke("getBrandWCPayRequest", <{$jsApiParameters}> , function(res) {
			WeixinJSBridge.log(res.err_msg);
			if (res.err_msg == "get_brand_wcpay_request:ok") {
				document.getElementById("payDom").style.display = "none";
				document.getElementById("successDom").style.display = "";
				setTimeout("window.location.href = '<{$returnUrl}>'", 2000);
			} else {
				if (res.err_msg == "get_brand_wcpay_request:cancel") {
					var err_msg = "您取消了支付";
				} else if (res.err_msg == "get_brand_wcpay_request:fail") {
					var err_msg = "支付失败<br/>错误信息：" + res.err_desc;
				} else {
					var err_msg = res.err_msg + "<br/>" + res.err_desc;
				}
				document.getElementById("payDom").style.display = "none";
				document.getElementById("failDom").style.display = "";
				document.getElementById("failRt").innerHTML = err_msg;
			}
		});
	}
	</script>



<div class="page">
	

	<div id="payDom" class="cardexplain">
		<p class="payInfo">支付信息：金额<span><{$price|number_format=###,2}></span>元</p>
		<p>
			<input type="button" onclick="callpay()"  class="am-btn am-btn-success am-btn-block am-round" value="点击进行微信支付" />
		</p>
	</div>


	<div id="failDom" style="display:none" class="cardexplain">
		
		<p class="payInfo">支付结果：支付失败<span id="failRt"></span></p>

		<p>
			<input type="button" onclick="callpay()"  class="am-btn am-btn-success am-btn-block am-round" value="重新进行支付" />
		</p>
	</div>


	<div id="successDom" style="display:none" class="cardexplain">
		<p class="payInfo">支付成功</p>
		<p>您已支付成功，页面正在跳转...请稍候</p>
	</div>

</div>

	<footer data-am-widget="footer" class="am-footer am-footer-default"  data-am-footer="{}">
	    <div class="am-footer-miscs ">
	        <p>版权所有：<{:C("copyright")}></p>
	    </div>
	</footer>

	<script>
	var mid = document.getElementById("loading");
	$(mid).height($(document).height());
	$(window).load(function() {
	   $(mid).hide();
	});
	</script>

</div>
</body>
</html>
